import request from '@/utils/request'

/**
* 实现新增部门功能
* @param {code,introduce,manager,name,pid} data
*/
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

/**
* 查询部门列表根据ID修改部门详情
* @param
* @rutures
*/
export function getDepartments() {
  return request({
    url: '/company/department',
    method: 'get'
  })
}
/**
* 根据ID修改部门详情
* @param {code,introduce,manager,name,pid} data
* @rutures
*/
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
/**
* 根据ID删除部门
* @param
* @rutures
*/
export function delDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
/**
* 根据ID获取部门详情
* @param
* @rutures
*/
export function getDepartmentsDetails(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'get'
  })
}
